package com.hbnu.tagyalu;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class WriterDemo {
    public static void main(String[] args) {
        String path="D:"+File.separator+"program"+File.separator+"tttt.txt";
        File file=new File(path);
        Writer writer=null;
        try {
            writer=new FileWriter(file);
            String content="没有投屏烦得很，";
            writer.flush();
        }
        catch (IOException e){
            e.printStackTrace();
        }
        finally{
            try {
                if (writer!=null) {
                    writer.close();
                }
            }catch (IOException e){
                e.printStackTrace();
            }
        }
    }
}
